<html lang="zh-CN"><head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="renderer" content="webkit">
  <title>js_new</title>
  <link rel="stylesheet" href="https://portal-static.tongdun.cn/static-public/seed/Ueditor-style/1.0.0/Ueditor-style.css">
  <link rel="stylesheet" href="https://portal-static.tongdun.cn/static-public/seed/Ueditor/1.0.0/utf8-jsp/third-party/SyntaxHighlighter/shCoreDefault.css">
  <script src="https://portal-static.tongdun.cn/static-public/seed/Ueditor/1.0.0/utf8-jsp/third-party/SyntaxHighlighter/shCore.js" type="text/javascript"></script>

</head>
<body>
<p style="text-align: right;"><button id="downloadHtml" style="font-family: inherit;font-size: inherit;font-style: inherit;font-variant-caps: inherit;font-weight: inherit;font-stretch: inherit;line-height: inherit">下载文档</button></p><h2 style="box-sizing: border-box;break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);width: inherit;color: rgb(51, 51, 51);font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;white-space: normal;background-color: rgb(255, 255, 255)"><a style="box-sizing: border-box;cursor: pointer;color: rgb(65, 131, 196)" name="header-n0"></a>集成方案</h2><h3 style="box-sizing: border-box;break-after: avoid-page;break-inside: avoid;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;width: inherit;color: rgb(51, 51, 51);font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;white-space: normal;background-color: rgb(255, 255, 255)"><a style="box-sizing: border-box;cursor: pointer;color: rgb(65, 131, 196)" name="header-n3"></a>a. 初始化，将以下代码嵌入关键业务入口页面的head标签内。</h3><pre spellcheck="false" class="brush:js;toolbar:false;" lang="" style="box-sizing: border-box;font-family: var(--monospace);font-size: 0.9em;break-inside: unset;overflow: visible;white-space: normal;background-image: inherit;background-size: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 1em 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);position: relative !important">&lt;script&nbsp;src="https://static.tongdun.net/monitor/monitor.js"&nbsp;&nbsp;async&nbsp;crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;script&nbsp;type="text/javascript"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;(function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window._fmOpt&nbsp;=&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;partner:&nbsp;'changyou',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;appName:&nbsp;'changyou_web',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;token:&nbsp;'changyou'&nbsp;+&nbsp;"-"&nbsp;+&nbsp;new&nbsp;Date().getTime()&nbsp;+&nbsp;"-"+&nbsp;Math.random().toString(16).substr(2),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fmb:&nbsp;true,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success:&nbsp;function(data)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;在成功完成采集后，success回调中可以获取到blackbox，在获取到blackbox后传输过程中请进行url编码
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log('blackbox:&nbsp;',&nbsp;data)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fpHost:"https://fp.tongdun.net"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;cimg&nbsp;=&nbsp;new&nbsp;Image(1,1);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cimg.onload&nbsp;=&nbsp;function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_fmOpt.imgLoaded&nbsp;=&nbsp;true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cimg.src&nbsp;=&nbsp;"https://fp.tongdun.net/fp/clear.png?
&nbsp;partnerCode=changyou&amp;appName=changyou_web&amp;tokenId="&nbsp;+&nbsp;_fmOpt.token;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;fm&nbsp;=&nbsp;document.createElement('script');&nbsp;fm.type&nbsp;=&nbsp;'text/javascript';&nbsp;
&nbsp;fm.async&nbsp;=&nbsp;true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fm.src&nbsp;=&nbsp;('https:'&nbsp;==&nbsp;document.location.protocol&nbsp;?&nbsp;'https://'&nbsp;:&nbsp;'http://')&nbsp;+&nbsp;
&nbsp;'static.tongdun.net/v3/fm.js?ver=0.1&amp;t='&nbsp;+&nbsp;(new&nbsp;Date().getTime()/3600000).toFixed(0);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;s&nbsp;=&nbsp;document.getElementsByTagName('script')[0];&nbsp;s.parentNode.insertBefore(fm,&nbsp;s);
&nbsp;&nbsp;&nbsp;&nbsp;})();
&lt;/script&gt;</pre><h3 style="box-sizing: border-box;break-after: avoid-page;break-inside: avoid;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;width: inherit;color: rgb(51, 51, 51);font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;white-space: normal;background-color: rgb(255, 255, 255)"><a style="box-sizing: border-box;cursor: pointer;color: rgb(65, 131, 196)" name="header-n5"></a>b. 获取设备指纹黑盒数据，并提交到业务服务器</h3><p style="box-sizing: border-box;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: normal;width: inherit;position: relative;color: rgb(51, 51, 51);font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color: rgb(255, 255, 255)">在<code style="box-sizing: border-box;font-family: var(--monospace);border: 1px solid rgb(225, 225, 232);background-color: rgb(247, 247, 249);border-radius: 3px;padding: 2px 4px;font-size: 0.9em;margin: 0px 5px;color: rgb(221, 17, 68);white-space: nowrap">_fmOpt</code>中设置success回调函数，成功获取到blackbox后，SDK会自动调用回调。</p><p style="box-sizing: border-box;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: normal;width: inherit;position: relative;color: rgb(51, 51, 51);font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color: rgb(255, 255, 255)"><code style="box-sizing: border-box;font-family: var(--monospace);border: 1px solid rgb(225, 225, 232);background-color: rgb(247, 247, 249);border-radius: 3px;padding: 2px 4px;font-size: 0.9em;margin: 0px 5px;color: rgb(221, 17, 68);white-space: nowrap">_fmOpt</code>参数说明：</p><p><br></p><figure style="box-sizing: border-box;overflow-x: auto;margin: 1.2em 0px;max-width: calc(100% + 16px);padding: 0px;color: rgb(51, 51, 51);font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;white-space: normal;background-color: rgb(255, 255, 255)"><table width="800"><thead style="box-sizing: border-box;background-color: rgb(248, 248, 248)"><tr style="box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px" class="firstRow"><th style="box-sizing: border-box;border-bottom: 0px;border-top-color: rgb(223, 226, 229);border-right-color: rgb(223, 226, 229);border-left-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">字段名</th><th style="box-sizing: border-box;border-bottom: 0px;border-top-color: rgb(223, 226, 229);border-right-color: rgb(223, 226, 229);border-left-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">类型</th><th style="box-sizing: border-box;border-bottom: 0px;border-top-color: rgb(223, 226, 229);border-right-color: rgb(223, 226, 229);border-left-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">含义</th><th style="box-sizing: border-box;border-bottom: 0px;border-top-color: rgb(223, 226, 229);border-right-color: rgb(223, 226, 229);border-left-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">备注</th></tr></thead><tbody style="box-sizing: border-box"><tr style="box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px"><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">partner</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">String</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">合作方名称</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">请勿随意更改</td></tr><tr style="box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px;background-color: rgb(248, 248, 248)"><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">appName</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">String</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">应用名称</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">请勿随意更改</td></tr><tr style="box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px"><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">token</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">String</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">请求标识</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">请勿随意更改，如需更改请保证每次请求的唯一性。</td></tr><tr style="box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px;background-color: rgb(248, 248, 248)"><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">fmb</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">Boolean</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">使用blackbox</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">默认开启。开启后，请使用blackbox查询设备信息。</td></tr><tr style="box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px"><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">timeout</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">Integer</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">采集超时时间</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">单位为ms，默认2000ms。超过指定时间未完成所有流程，则会获取到降级blacbox。</td></tr><tr style="box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px;background-color: rgb(248, 248, 248)"><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">success</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">Function</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">成功回调</td><td style="box-sizing: border-box;border-color: rgb(223, 226, 229);text-align: center;padding: 6px 13px">成功获取到blackbox后，会调用传入的回调。</td></tr></tbody></table></figure><p><br></p><h3 style="box-sizing: border-box;break-after: avoid-page;break-inside: avoid;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;width: inherit;color: rgb(51, 51, 51);font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;white-space: normal;background-color: rgb(255, 255, 255)"><a style="box-sizing: border-box;cursor: pointer;color: rgb(65, 131, 196)" name="header-n44"></a>c. FAQ</h3><p style="box-sizing: border-box;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: normal;width: inherit;position: relative;color: rgb(51, 51, 51);font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color: rgb(255, 255, 255)">Q: 为什么获取的black_box字段比较长？ A: 正常情况下black_box长度为200-250字节。在网络情况较差， black_box</p><p style="box-sizing: border-box;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: normal;width: inherit;position: relative;color: rgb(51, 51, 51);font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color: rgb(255, 255, 255)">&nbsp;&nbsp;&nbsp;&nbsp;可能会附带一些设备信息长度将增大到2000-3000字节。</p><p style="box-sizing: border-box;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: normal;width: inherit;position: relative;color: rgb(51, 51, 51);font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color: rgb(255, 255, 255)">Q: 为何部分事件的真实IP是空的？ A: 当SDK上传设备信息失败(超时或者网络被屏蔽)时，将自动转为离线模式，此种情况</p><p style="box-sizing: border-box;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: normal;width: inherit;position: relative;color: rgb(51, 51, 51);font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color: rgb(255, 255, 255)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下同盾无法获取真实IP。</p><p><br></p>
<script type="text/javascript">SyntaxHighlighter.all();</script>

<script>
  window.document.domain = 'tongdun.cn'
  function fake_click(obj) {
    var ev = document.createEvent("MouseEvents");
    ev.initMouseEvent(
      "click", true, false, window, 0, 0, 0, 0, 0
      , false, false, false, false, 0, null
    );
    obj.dispatchEvent(ev);
  }

  function export_raw(name, data) {
    var urlObject = window.URL || window.webkitURL || window;

    var export_blob = new Blob([data]);

    var save_link = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
    save_link.href = urlObject.createObjectURL(export_blob);
    save_link.download = name;
    fake_click(save_link);
  }
  var test=document.getElementsByTagName('html')[0].outerHTML;
  window.onload = function () {
    document.getElementById('downloadHtml').onclick = function() {
      export_raw('同盾js_new文档.html', test);
    };
  }
</script></body></html>